# Copyright 2019 Google LLC
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# NOTE: This file is auto generated by the elixir code generator program.
# Do not edit this file manually.

defmodule GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_Ad do
  @moduledoc """
  An ad.

  ## Attributes

  *   `displayUrl` (*type:* `String.t`, *default:* `nil`) - The URL that appears in the ad description for some ad formats.
  *   `expandedDynamicSearchAd` (*type:* `GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_SearchAds360ExpandedDynamicSearchAdInfo.t`, *default:* `nil`) - Immutable. Details pertaining to an expanded dynamic search ad.
  *   `expandedTextAd` (*type:* `GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_SearchAds360ExpandedTextAdInfo.t`, *default:* `nil`) - Immutable. Details pertaining to an expanded text ad.
  *   `finalUrls` (*type:* `list(String.t)`, *default:* `nil`) - The list of possible final URLs after all cross-domain redirects for the ad.
  *   `id` (*type:* `String.t`, *default:* `nil`) - Output only. The ID of the ad.
  *   `name` (*type:* `String.t`, *default:* `nil`) - Immutable. The name of the ad. This is only used to be able to identify the ad. It does not need to be unique and does not affect the served ad. The name field is currently only supported for DisplayUploadAd, ImageAd, ShoppingComparisonListingAd and VideoAd.
  *   `productAd` (*type:* `GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_SearchAds360ProductAdInfo.t`, *default:* `nil`) - Immutable. Details pertaining to a product ad.
  *   `resourceName` (*type:* `String.t`, *default:* `nil`) - Immutable. The resource name of the ad. Ad resource names have the form: `customers/{customer_id}/ads/{ad_id}`
  *   `responsiveSearchAd` (*type:* `GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_SearchAds360ResponsiveSearchAdInfo.t`, *default:* `nil`) - Immutable. Details pertaining to a responsive search ad.
  *   `textAd` (*type:* `GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_SearchAds360TextAdInfo.t`, *default:* `nil`) - Immutable. Details pertaining to a text ad.
  *   `type` (*type:* `String.t`, *default:* `nil`) - Output only. The type of ad.
  """

  use GoogleApi.Gax.ModelBase

  @type t :: %__MODULE__{
          :displayUrl => String.t() | nil,
          :expandedDynamicSearchAd =>
            GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_SearchAds360ExpandedDynamicSearchAdInfo.t()
            | nil,
          :expandedTextAd =>
            GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_SearchAds360ExpandedTextAdInfo.t()
            | nil,
          :finalUrls => list(String.t()) | nil,
          :id => String.t() | nil,
          :name => String.t() | nil,
          :productAd =>
            GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_SearchAds360ProductAdInfo.t()
            | nil,
          :resourceName => String.t() | nil,
          :responsiveSearchAd =>
            GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_SearchAds360ResponsiveSearchAdInfo.t()
            | nil,
          :textAd =>
            GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_SearchAds360TextAdInfo.t()
            | nil,
          :type => String.t() | nil
        }

  field(:displayUrl)

  field(:expandedDynamicSearchAd,
    as:
      GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_SearchAds360ExpandedDynamicSearchAdInfo
  )

  field(:expandedTextAd,
    as:
      GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_SearchAds360ExpandedTextAdInfo
  )

  field(:finalUrls, type: :list)
  field(:id)
  field(:name)

  field(:productAd,
    as: GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_SearchAds360ProductAdInfo
  )

  field(:resourceName)

  field(:responsiveSearchAd,
    as:
      GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_SearchAds360ResponsiveSearchAdInfo
  )

  field(:textAd,
    as: GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Common_SearchAds360TextAdInfo
  )

  field(:type)
end

defimpl Poison.Decoder, for: GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_Ad do
  def decode(value, options) do
    GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_Ad.decode(value, options)
  end
end

defimpl Poison.Encoder, for: GoogleApi.SearchAds360.V0.Model.GoogleAdsSearchads360V0Resources_Ad do
  def encode(value, options) do
    GoogleApi.Gax.ModelBase.encode(value, options)
  end
end
